﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace NMapper
{
    public interface IMapper<TDatabase>
        where TDatabase : IDisposable
    {
        ISelectors<TDatabase> PrimaryKey { get; }
        void Initialize(); 
        Type TransientType { get; }
        LambdaExpression CreateTransientSelector(MapContext<TDatabase> context);
        Type OutputType { get; }
        void OnTransientInitialized(MapContext<TDatabase> mapContext, Array array);
        void MapToOutput(MapContext<TDatabase> mapContext, object transient, object output);
        void MapToInput(MapContext<TDatabase> mapContext, object output, object input);
        object[] TransformToInput(MapContext<TDatabase> mapContext, object[] output, Func<int[], IEnumerable<object>> fetch);
        object[] TransformToOutput(MapContext<TDatabase> mapContext, Array transient);
    }

    public interface IMapper<TDatabase, in TDatabaseEntity, in TOutput> : IMapper<TDatabase>
        where TDatabase : IDisposable
    {
    }
}